.class public Lnet/tsapps/topdeals/views/CommentView;
.super Landroid/widget/FrameLayout;


# instance fields
.field private a:Landroid/widget/FrameLayout;

.field private b:Landroid/widget/TextView;

.field private c:Landroid/widget/TextView;

.field private d:Landroid/widget/TextView;

.field private e:Landroid/widget/ImageView;

.field private f:Landroid/widget/ImageView;

.field private g:Landroid/widget/ImageView;

.field private h:Lnet/tsapps/topdeals/objects/Comment;

.field private i:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0

    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    invoke-direct {p0}, Lnet/tsapps/topdeals/views/CommentView;->a()V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0

    invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    invoke-direct {p0}, Lnet/tsapps/topdeals/views/CommentView;->a()V

    return-void
.end method

.method private a()V
    .locals 2

    invoke-virtual {p0}, Lnet/tsapps/topdeals/views/CommentView;->getContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "layout_inflater"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    const/high16 v1, 0x7f03

    invoke-virtual {v0, v1, p0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/FrameLayout;

    iput-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->a:Landroid/widget/FrameLayout;

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->a:Landroid/widget/FrameLayout;

    const v1, 0x7f050006

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->b:Landroid/widget/TextView;

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->a:Landroid/widget/FrameLayout;

    const v1, 0x7f050007

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->c:Landroid/widget/TextView;

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->a:Landroid/widget/FrameLayout;

    const v1, 0x7f05000b

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->d:Landroid/widget/TextView;

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->a:Landroid/widget/FrameLayout;

    const v1, 0x7f050005

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->e:Landroid/widget/ImageView;

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->a:Landroid/widget/FrameLayout;

    const v1, 0x7f05000a

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->g:Landroid/widget/ImageView;

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->a:Landroid/widget/FrameLayout;

    const v1, 0x7f050009

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->f:Landroid/widget/ImageView;

    return-void
.end method

.method static synthetic a(Lnet/tsapps/topdeals/views/CommentView;)Z
    .locals 1

    iget-boolean v0, p0, Lnet/tsapps/topdeals/views/CommentView;->i:Z

    return v0
.end method

.method static synthetic b(Lnet/tsapps/topdeals/views/CommentView;)Landroid/widget/TextView;
    .locals 1

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->d:Landroid/widget/TextView;

    return-object v0
.end method

.method static synthetic c(Lnet/tsapps/topdeals/views/CommentView;)Lnet/tsapps/topdeals/objects/Comment;
    .locals 1

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->h:Lnet/tsapps/topdeals/objects/Comment;

    return-object v0
.end method

.method static synthetic d(Lnet/tsapps/topdeals/views/CommentView;)V
    .locals 1

    const/4 v0, 0x0

    iput-boolean v0, p0, Lnet/tsapps/topdeals/views/CommentView;->i:Z

    return-void
.end method


# virtual methods
.method public final a(Lnet/tsapps/topdeals/objects/Comment;)V
    .locals 5

    const/4 v4, 0x1

    iput-object p1, p0, Lnet/tsapps/topdeals/views/CommentView;->h:Lnet/tsapps/topdeals/objects/Comment;

    invoke-virtual {p0}, Lnet/tsapps/topdeals/views/CommentView;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "comment_device_"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget v2, p1, Lnet/tsapps/topdeals/objects/Comment;->e:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const-string v2, "drawable"

    invoke-virtual {p0}, Lnet/tsapps/topdeals/views/CommentView;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    move-result v0

    if-eqz v0, :cond_0

    iget-object v1, p0, Lnet/tsapps/topdeals/views/CommentView;->e:Landroid/widget/ImageView;

    invoke-virtual {v1, v0}, Landroid/widget/ImageView;->setImageResource(I)V

    :cond_0
    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->b:Landroid/widget/TextView;

    iget-object v1, p1, Lnet/tsapps/topdeals/objects/Comment;->c:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->c:Landroid/widget/TextView;

    iget-object v1, p1, Lnet/tsapps/topdeals/objects/Comment;->b:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    iget v0, p1, Lnet/tsapps/topdeals/objects/Comment;->h:I

    if-nez v0, :cond_2

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->d:Landroid/widget/TextView;

    const/4 v1, 0x3

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setGravity(I)V

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->d:Landroid/widget/TextView;

    const/high16 v1, -0x100

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V

    :cond_1
    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->d:Landroid/widget/TextView;

    iget-object v1, p1, Lnet/tsapps/topdeals/objects/Comment;->d:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lnet/tsapps/topdeals/views/CommentView;->i:Z

    :goto_0
    return-void

    :cond_2
    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->d:Landroid/widget/TextView;

    const/16 v1, 0x11

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setGravity(I)V

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->d:Landroid/widget/TextView;

    const v1, -0x777778

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V

    iget v0, p1, Lnet/tsapps/topdeals/objects/Comment;->h:I

    if-ne v0, v4, :cond_1

    iget-object v0, p0, Lnet/tsapps/topdeals/views/CommentView;->d:Landroid/widget/TextView;

    const-string v1, "- Kommentar anzeigen -"

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    iput-boolean v4, p0, Lnet/tsapps/topdeals/views/CommentView;->i:Z

    goto :goto_0
.end method

.method protected onAttachedToWindow()V
    .locals 1

    invoke-super {p0}, Landroid/widget/FrameLayout;->onAttachedToWindow()V

    new-instance v0, Lnet/tsapps/topdeals/views/d;

    invoke-direct {v0, p0}, Lnet/tsapps/topdeals/views/d;-><init>(Lnet/tsapps/topdeals/views/CommentView;)V

    invoke-virtual {p0, v0}, Lnet/tsapps/topdeals/views/CommentView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    new-instance v0, Lnet/tsapps/topdeals/views/e;

    invoke-direct {v0, p0}, Lnet/tsapps/topdeals/views/e;-><init>(Lnet/tsapps/topdeals/views/CommentView;)V

    invoke-virtual {p0, v0}, Lnet/tsapps/topdeals/views/CommentView;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V

    return-void
.end method

.method protected onDetachedFromWindow()V
    .locals 1

    const/4 v0, 0x0

    invoke-super {p0}, Landroid/widget/FrameLayout;->onDetachedFromWindow()V

    invoke-virtual {p0, v0}, Lnet/tsapps/topdeals/views/CommentView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    invoke-virtual {p0, v0}, Lnet/tsapps/topdeals/views/CommentView;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V

    return-void
.end method

.method protected onMeasure(II)V
    .locals 11

    const/4 v10, -0x1

    const-wide/high16 v8, 0x4059

    invoke-super {p0, p1, p2}, Landroid/widget/FrameLayout;->onMeasure(II)V

    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v0

    iget-object v1, p0, Lnet/tsapps/topdeals/views/CommentView;->h:Lnet/tsapps/topdeals/objects/Comment;

    iget v1, v1, Lnet/tsapps/topdeals/objects/Comment;->g:I

    iget-object v2, p0, Lnet/tsapps/topdeals/views/CommentView;->h:Lnet/tsapps/topdeals/objects/Comment;

    iget v2, v2, Lnet/tsapps/topdeals/objects/Comment;->f:I

    add-int/2addr v1, v2

    const/16 v2, 0x32

    if-gt v1, v2, :cond_0

    div-int/lit8 v1, v0, 0x32

    iget-object v2, p0, Lnet/tsapps/topdeals/views/CommentView;->h:Lnet/tsapps/topdeals/objects/Comment;

    iget v2, v2, Lnet/tsapps/topdeals/objects/Comment;->f:I

    mul-int/2addr v1, v2

    int-to-float v1, v1

    invoke-static {v1}, Ljava/lang/Math;->round(F)I

    move-result v1

    div-int/lit8 v0, v0, 0x32

    iget-object v2, p0, Lnet/tsapps/topdeals/views/CommentView;->h:Lnet/tsapps/topdeals/objects/Comment;

    iget v2, v2, Lnet/tsapps/topdeals/objects/Comment;->g:I

    mul-int/2addr v0, v2

    int-to-float v0, v0

    invoke-static {v0}, Ljava/lang/Math;->round(F)I

    move-result v0

    iget-object v2, p0, Lnet/tsapps/topdeals/views/CommentView;->g:Landroid/widget/ImageView;

    new-instance v3, Landroid/widget/LinearLayout$LayoutParams;

    invoke-direct {v3, v1, v10}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    iget-object v1, p0, Lnet/tsapps/topdeals/views/CommentView;->f:Landroid/widget/ImageView;

    new-instance v2, Landroid/widget/LinearLayout$LayoutParams;

    invoke-direct {v2, v0, v10}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    :goto_0
    return-void

    :cond_0
    int-to-double v2, v0

    int-to-double v4, v1

    div-double v4, v8, v4

    iget-object v6, p0, Lnet/tsapps/topdeals/views/CommentView;->h:Lnet/tsapps/topdeals/objects/Comment;

    iget v6, v6, Lnet/tsapps/topdeals/objects/Comment;->f:I

    int-to-double v6, v6

    div-double/2addr v6, v8

    mul-double/2addr v4, v6

    mul-double/2addr v2, v4

    invoke-static {v2, v3}, Ljava/lang/Math;->round(D)J

    move-result-wide v2

    int-to-double v4, v0

    int-to-double v0, v1

    div-double v0, v8, v0

    iget-object v6, p0, Lnet/tsapps/topdeals/views/CommentView;->h:Lnet/tsapps/topdeals/objects/Comment;

    iget v6, v6, Lnet/tsapps/topdeals/objects/Comment;->g:I

    int-to-double v6, v6

    mul-double/2addr v0, v6

    div-double/2addr v0, v8

    mul-double/2addr v0, v4

    invoke-static {v0, v1}, Ljava/lang/Math;->round(D)J

    move-result-wide v0

    iget-object v4, p0, Lnet/tsapps/topdeals/views/CommentView;->g:Landroid/widget/ImageView;

    new-instance v5, Landroid/widget/LinearLayout$LayoutParams;

    long-to-int v2, v2

    invoke-direct {v5, v2, v10}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    iget-object v2, p0, Lnet/tsapps/topdeals/views/CommentView;->f:Landroid/widget/ImageView;

    new-instance v3, Landroid/widget/LinearLayout$LayoutParams;

    long-to-int v0, v0

    invoke-direct {v3, v0, v10}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    goto :goto_0
.end method
